/*
 * @Description:
 * @Date: 2023-02-24 15:15:05
 */
// 后续独立运行扩展
function emptyAction(...args) {
  // 警告：提示当前使用的是空 Action
  console.warn("Current execute action is empty!");
}

class Actions {
  actions = {
    onGlobalStateChange: emptyAction,
    setGlobalState: emptyAction
  };
  constructor() {}
  // 默认值为空Action

  // 设置actions
  setActions(baseactions) {
    this.actions = baseactions;
  }

  // 映射
  onGlobalStateChange(...args) {
    return this.actions.onGlobalStateChange(...args);
  }
  // 映射
  setGlobalState(...args) {
    return this.actions.setGlobalState(...args);
  }
}

const actions = new Actions();
export default actions;
